//
//  QJNearShopDetailHeaderView.m
//  QuanJieShopProject
//
//  Created by 刘中义 on 2018/2/14.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "QJNearShopDetailHeaderView.h"
//星级评价
#import "QJStartView.h"
@implementation QJNearShopDetailHeaderView
- (void)headerUpdateDataWithDic:(NSDictionary *)dict{
    if (dict) {
        [self.headerImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",NET_BASEURL_IMG,dict[@"image_url"]]] placeholderImage:[UIImage imageNamed:@"noImage"]];
        self.headerTitle.text = [NSString stringWithFormat:@"%@",dict[@"shop_name"]];
        QJStartView *startView = [[QJStartView alloc]initWithFrame:self.headerStarView.bounds numberOfStars:5 rateStyle:HalfStar isAnination:YES delegate:self];
        [self.headerStarView addSubview:startView];
        startView.currentScore = [dict[@"star"] floatValue];
        self.headerRule.text = [NSString stringWithFormat:@"·车位等情况请电联商家，获取实时信息\n·本单位发票由商家提供，请在消费时向商家索取\n·消费时，请当面见证商家拨付银元宝，并确保个人账户信息准确无误"];
        self.headerAddress.text = [NSString stringWithFormat:@"%@",dict[@"detail_address"]];
        self.headerTime.text = [NSString stringWithFormat:@"%@高峰期需要等位",dict[@"business_hours"]];
        self.headerYYTime.text = [NSString stringWithFormat:@"营业时间：周一至周日"];
        self.headerCW.text = [NSString stringWithFormat:@"%@车位",dict[@"cw"]];
        
    }
}
- (IBAction)btnClickAction:(UIButton *)sender {
    NSInteger tag = sender.tag;
    if (self.headerBtnClickBlock) {
        self.headerBtnClickBlock(tag);
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
